<?php
	//error_reporting(0);					//屏蔽错误信息
	header("Content-type: text/html; charset=utf-8");
	date_default_timezone_set('PRC');		//设置中国时区
	
	define('ROOT_PATH',dirname(__FILE__));
	define('MODEL_PATH',ROOT_PATH.'/../model/');

	function newInstance() {
		$arguments = func_get_args();
		$className = array_shift($arguments);
		
		require_once MODEL_PATH.$className.'.class.php';

		$class = new ReflectionClass($className);
		$class = empty($arguments)?$class->newInstanceArgs():$class->newInstanceArgs($arguments['0']);
		return $class;
	}
	
	//数据库初始化配置
	include_once ROOT_PATH.'/config.php';
	newInstance('DBConfig')->setConfig($DBConfig);

	include_once MODEL_PATH.'Mysql.class.php';
	include_once MODEL_PATH.'common.class.php';
	
	
	//引入smarty配置文件
	require('template.inc.php');
	
	$commonc = newInstance('common');
?>